/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.uff.ihc.bd.tabelas;

import br.uff.ihc.bd.entidades.Exame;
import br.uff.ihc.bd.entidades.Medico;
import br.uff.ihc.bd.entidades.Paciente;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 *
 * @author karol
 */
public class TB_Exame {

    private Exame exame;
    private static int numeroExame;
    private List<Exame> listaExames;

    public TB_Exame() {
        numeroExame = 123;
        listaExames = new ArrayList<Exame>();
        preencheLista();
    }

    public void addNovoExame(String cs, String m, Date dataConsulta, String horaConsulta, String desc, String tipo, String local) {
        exame = new Exame();
        exame.setPaciente(cs);
        exame.setMedicoResponsavel(m);
        exame.setDataExame(dataConsulta);
        exame.setHoraExame(horaConsulta);
        exame.setNumeroExame(numeroExame);
        exame.setDescricao(desc);
        exame.setLocal(local);
        exame.setTipoExame(tipo);
        exame.setConfirmado(false);

        listaExames.add(exame);
        numeroExame++;
    }

    public void removeExame(Exame e) {
        listaExames.remove(e);
    }

    public List<Exame> selectAll() {
        return listaExames;
    }

    public Exame confirmaExame(Exame e) {
        e.setConfirmado(true);
        return e;
    }

    public void preencheLista() {

        addNovoExame("1111", "Dra. Amanada", new Date("25/01/2012"), "11:30", "Exame de Urina", "Exame de Urina", "UPA Fonseca");
        addNovoExame("1111", "Dra. Bruna", new Date("25/01/2012"), "11:30", "Exame de Urina", "Hemograma Completo", "UPA Fonseca");
        addNovoExame("2222", "Dra. Rafaela", new Date("10/01/2012"), "10:30", "Exame de Urina", "Exame de Urina", "Policlinica");
        addNovoExame("3333", "Dr. Ronaldo", new Date("05/01/2012"), "08:30", "Exame de Urina", "Hemograma Completo", "Antonio Pedro");
        addNovoExame("4444", "Dr. Ronaldo", new Date("05/01/2012"), "08:30", "Exame de Urina", "Hemograma Completo", "Policlinica");
        addNovoExame("1111", "Dra. Amanda", new Date("30/01/2012"), "13:00", "Exame de Urina", "Exame de Fezes", "Policlinica");
    }
}
